package com.biz.primus.ms.oms.dao.po.returns;

import com.biz.primus.ms.base.jpa.po.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.time.LocalDateTime;

/**
 * 退款单,必须根据退货单生成
 *
 * @author yanweijin
 * @date 2017/11/9
 */
@Data
@Entity
@Table(name = "oms_refund", indexes = {
		@Index(name = "idx_user_id",columnList = "userId"),
		@Index(name = "idx_order_id",columnList = "orderId"),
		@Index(name = "idx_return_id",columnList = "returnId")
})
public class OmsRefund extends BaseEntity {

	/**
	 * 关联的退单id
	 */
	@Column(nullable = false)
	private Long returnId;

	/**
	 * 关联的订单id
	 */
	@Column(nullable = false)
	private Long orderId;

	/**
	 * 关联的用户id
	 */
	@Column(nullable = false)
	private Long userId;

	/**
	 * 退款金额
	 */
	@Column(nullable = false)
	private Integer refundAmount;


	@Column(nullable = false, length = 50)
	private String refundCode;

	/**
	 * 退款操作员工编号
	 */
	private String refundOperator;

	/**
	 * 备注信息
	 */
	private String remark;

	/**
	 * 退款时间
	 */
	private LocalDateTime refundTime;

	/**
	 * 退款状态
	 */
	@Enumerated(EnumType.STRING)
	@Column(length = 50)
	private RefundState refundState;

	/**
	 * 退款银行
	 */
	@Column(length = 50)
	private String refundBank;

	/**
	 * 退款银行账号
	 */
	@Column(length = 50)
	private String refundBankAccount;

	/**
	 * 退款人
	 */
	@Column(length = 50)
	private String refundReceiver;

	/**
	 * 退款方式
	 */
	@Column(length = 50)
	private String refundWays;
}
